package com.atguigu.responsibilityChain;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description: 请求的处理者（审批者-学院院长）
 * @create: 2022-04-05 16:39
 **/
public class CollegeApprover extends Approver{

    /**
     * 构造方法（）
     * @param name 审批人的姓名
     */
    public CollegeApprover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getPrice() > 5000 && purchaseRequest.getPrice() <= 10000){
            System.out.println("请求编号 id= " + purchaseRequest.getId() + " 被 " + this.name + "处理");
        }else {
            approver.processRequest(purchaseRequest);
        }
    }
}
